// Copyright (C) Kumo inc. and its affiliates.
// Author: Jeff.li lijippy@163.com
// All rights reserved.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.
//


#include <pollux/functions/registerer.h>
#include <pollux/functions/prestosql/string_functions.h>
#include <pollux/functions/prestosql/url_functions.h>

namespace kumo::pollux::functions {
    void registerURLFunctions(const std::string &prefix) {
        register_function<UrlExtractHostFunction, Varchar, Varchar>(
            {prefix + "url_extract_host"});
        register_function<UrlExtractFragmentFunction, Varchar, Varchar>(
            {prefix + "url_extract_fragment"});
        register_function<UrlExtractPathFunction, Varchar, Varchar>(
            {prefix + "url_extract_path"});
        register_function<UrlExtractParameterFunction, Varchar, Varchar, Varchar>(
            {prefix + "url_extract_parameter"});
        register_function<UrlExtractProtocolFunction, Varchar, Varchar>(
            {prefix + "url_extract_protocol"});
        register_function<UrlExtractPortFunction, int64_t, Varchar>(
            {prefix + "url_extract_port"});
        register_function<UrlExtractQueryFunction, Varchar, Varchar>(
            {prefix + "url_extract_query"});
        register_function<UrlEncodeFunction, Varchar, Varchar>(
            {prefix + "url_encode"});
        register_function<UrlDecodeFunction, Varchar, Varchar>(
            {prefix + "url_decode"});
    }
} // namespace kumo::pollux::functions
